package com.liang.design;

/**
 * @author lsm
 * @ClassName Singleton_02.java
 * @Description 懒汉式(线程安全)
 * @createTime 2023年12月01日 10:36:00
 */
public class Singleton_02 {

    private static Singleton_02 instance;

    private Singleton_02(){}

    public static synchronized Singleton_02 getInstance(){
        if (instance==null){
            instance = new Singleton_02();
        }
        return instance;
    }
}
